/* tslint:disable:max-line-length */

import SVGPoints from '@core/helpers/SVGPoints';
import * as tape from 'tape';

tape(
  'SVGPoints.pathToPoints',
  (t) => {
    const ps1 = SVGPoints.pathToPoints('M250,100L400,400L100,400Z');
    t.equal(
      JSON.stringify(ps1),
      '[{"x":250,"y":100,"moveTo":true},{"x":400,"y":400},{"x":100,"y":400,"closed":true},{"x":250,"y":100}]',
    );

    const ps2 = SVGPoints.pathToPoints('M55.5,110.601562 C86.1518036,110.601562 111,106.857389 111,102.238717 C111,99.1596016 111,65.0800295 111,0 L9.35015954,0.681650094 C-4.46240267,66.5736874 -1.13686838e-13,100.426043 -1.13686838e-13,102.238717 C-1.13686838e-13,106.857389 24.8481964,110.601562 55.5,110.601562 Z');
    t.equal(
      JSON.stringify(ps2),
      '[{"x":55.5,"y":110.601562,"moveTo":true},{"curve":{"type":"cubic","x1":86.1518036,"y1":110.601562,"x2":111,"y2":106.857389},"x":111,"y":102.238717},{"curve":{"type":"cubic","x1":111,"y1":99.1596016,"x2":111,"y2":65.0800295},"x":111,"y":0},{"x":9.35015954,"y":0.681650094},{"curve":{"type":"cubic","x1":-4.46240267,"y1":66.5736874,"x2":-1.13686838e-13,"y2":100.426043},"x":-1.13686838e-13,"y":102.238717},{"curve":{"type":"cubic","x1":-1.13686838e-13,"y1":106.857389,"x2":24.8481964,"y2":110.601562},"x":55.5,"y":110.601562,"closed":true}]',
    );

    const ps3 = SVGPoints.pathToPoints('M55.5,110.601562 C86.1518036,110.601562 111,106.857389 111,102.238717 C111,99.1596016 111,65.0800295 111,0 L9.35015954,0.681650094 C-4.46240267,66.5736874 -1.13686838e+2,100.426043 -1.13686838e+20,102.238717 C-1.13686838e-13,106.857389 24.8481964,110.601562 55.5,110.601562 Z');
    t.equal(
      JSON.stringify(ps3),
      '[{"x":55.5,"y":110.601562,"moveTo":true},{"curve":{"type":"cubic","x1":86.1518036,"y1":110.601562,"x2":111,"y2":106.857389},"x":111,"y":102.238717},{"curve":{"type":"cubic","x1":111,"y1":99.1596016,"x2":111,"y2":65.0800295},"x":111,"y":0},{"x":9.35015954,"y":0.681650094},{"curve":{"type":"cubic","x1":-4.46240267,"y1":66.5736874,"x2":-113.686838,"y2":100.426043},"x":-113686838000000000000,"y":102.238717},{"curve":{"type":"cubic","x1":-1.13686838e-13,"y1":106.857389,"x2":24.8481964,"y2":110.601562},"x":55.5,"y":110.601562,"closed":true}]',
    );

    const ps4 = SVGPoints.pathToPoints('M134.183594,63.6757812 C133.363277,66.7382966 132.539067,69.5195188 131.710938,72.0195312 C131.476561,72.7226598 131.093753,73.4453088 130.5625,74.1875 C130.187498,74.7031276 129.687503,74.9570313 129.0625,74.9492188 C128.07812,74.9335937 127.30469,73.9843844 126.742188,72.1015625 C126.531249,71.3828089 126.281251,70.0429786 125.992188,68.0820312 C125.828124,68.425783 125.726563,68.6562494 125.6875,68.7734375 C125.281248,69.7421923 124.687504,71.2460836 123.90625,73.2851562 C123.789062,73.6132829 123.613282,73.874999 123.378906,74.0703125 C123.05078,74.5937526 122.562503,74.8671874 121.914062,74.890625 C121.546873,74.9062501 121.160158,74.5781284 120.753906,73.90625 C120.324217,73.2265591 119.976564,72.3515679 119.710938,71.28125 C119.468749,70.3124952 119.093753,68.2031413 118.585938,64.953125 C118.476562,64.2499965 118.421875,63.6992207 118.421875,63.3007812 C118.421875,62.8710916 118.583983,62.5136733 118.908203,62.2285156 C119.232423,61.9433579 119.621091,61.8007812 120.074219,61.8007812 C120.917973,61.8007812 121.437499,62.2187458 121.632812,63.0546875 C121.734376,63.4921897 121.820312,64.0312468 121.890625,64.671875 C121.984375,65.5937546 122.042969,66.1367179 122.066406,66.3007812 C122.167969,66.9101593 122.324218,67.9062431 122.535156,69.2890625 C123.113284,67.7031171 123.77734,65.7304805 124.527344,63.3710938 C124.847658,62.3554637 125.449214,61.8476562 126.332031,61.8476562 C127.199223,61.8476562 127.76953,62.4140568 128.042969,63.546875 C128.238282,64.343754 128.445311,65.3788999 128.664062,66.6523438 C128.984377,68.5039155 129.179687,69.605467 129.25,69.9570312 C129.320313,69.7148425 129.933588,67.3398663 131.089844,62.8320312 C131.26172,62.1601529 131.749996,61.8242188 132.554688,61.8242188 C133.000002,61.8242188 133.392576,61.9687486 133.732422,62.2578125 C134.072267,62.5468764 134.242188,62.9062479 134.242188,63.3359375 C134.242188,63.4140629 134.222656,63.527343 134.183594,63.6757812 Z M140.441406,74.6914062 C138.996087,74.6914062 137.753911,74.1953175 136.714844,73.203125 C135.574213,72.1171821 134.976563,70.6679778 134.921875,68.8554688 C134.867187,67.1288976 135.339839,65.5898505 136.339844,64.2382812 C137.52735,62.6445233 139.179677,61.8476562 141.296875,61.8476562 C142.859383,61.8476562 144.101558,62.47265 145.023438,63.7226562 C145.851567,64.8476619 146.265625,66.2421792 146.265625,67.90625 C146.265625,69.7187591 145.781255,71.2656186 144.8125,72.546875 C143.726557,73.9765696 142.26954,74.6914062 140.441406,74.6914062 Z M141.144531,64.9414062 C140.183589,64.9335937 139.425784,65.3710893 138.871094,66.2539062 C138.402341,66.9960975 138.167969,67.8632763 138.167969,68.8554688 C138.167969,69.7929734 138.433591,70.5117163 138.964844,71.0117188 C139.386721,71.4101582 139.878903,71.609375 140.441406,71.609375 C141.121097,71.609375 141.710935,71.3789086 142.210938,70.9179688 C142.781253,70.3789036 143.085937,69.6484421 143.125,68.7265625 C143.226563,66.2109249 142.566413,64.9492188 141.144531,64.9414062 Z M163.222656,63.6757812 C162.40234,66.7382966 161.578129,69.5195188 160.75,72.0195312 C160.515624,72.7226598 160.132815,73.4453088 159.601562,74.1875 C159.226561,74.7031276 158.726566,74.9570313 158.101562,74.9492188 C157.117183,74.9335937 156.343753,73.9843844 155.78125,72.1015625 C155.570311,71.3828089 155.320314,70.0429786 155.03125,68.0820312 C154.867187,68.425783 154.765625,68.6562494 154.726562,68.7734375 C154.32031,69.7421923 153.726566,71.2460836 152.945312,73.2851562 C152.828124,73.6132829 152.652345,73.874999 152.417969,74.0703125 C152.089842,74.5937526 151.601566,74.8671874 150.953125,74.890625 C150.585936,74.9062501 150.199221,74.5781284 149.792969,73.90625 C149.363279,73.2265591 149.015626,72.3515679 148.75,71.28125 C148.507811,70.3124952 148.132815,68.2031413 147.625,64.953125 C147.515624,64.2499965 147.460938,63.6992207 147.460938,63.3007812 C147.460938,62.8710916 147.623045,62.5136733 147.947266,62.2285156 C148.271486,61.9433579 148.660154,61.8007812 149.113281,61.8007812 C149.957035,61.8007812 150.476562,62.2187458 150.671875,63.0546875 C150.773438,63.4921897 150.859375,64.0312468 150.929688,64.671875 C151.023438,65.5937546 151.082031,66.1367179 151.105469,66.3007812 C151.207032,66.9101593 151.36328,67.9062431 151.574219,69.2890625 C152.152347,67.7031171 152.816402,65.7304805 153.566406,63.3710938 C153.88672,62.3554637 154.488277,61.8476562 155.371094,61.8476562 C156.238286,61.8476562 156.808592,62.4140568 157.082031,63.546875 C157.277345,64.343754 157.484374,65.3788999 157.703125,66.6523438 C158.023439,68.5039155 158.21875,69.605467 158.289062,69.9570312 C158.359375,69.7148425 158.97265,67.3398663 160.128906,62.8320312 C160.300782,62.1601529 160.789058,61.8242188 161.59375,61.8242188 C162.039065,61.8242188 162.431639,61.9687486 162.771484,62.2578125 C163.11133,62.5468764 163.28125,62.9062479 163.28125,63.3359375 C163.28125,63.4140629 163.261719,63.527343 163.222656,63.6757812 Z M167.324219,59.9140625 C166.824216,59.9140625 166.390627,59.7460954 166.023438,59.4101562 C165.656248,59.0742171 165.472656,58.6640649 165.472656,58.1796875 C165.472656,57.6953101 165.656248,57.2851579 166.023438,56.9492188 C166.390627,56.6132796 166.824216,56.4453125 167.324219,56.4453125 C167.824221,56.4453125 168.255858,56.6132796 168.619141,56.9492188 C168.982424,57.2851579 169.164062,57.6953101 169.164062,58.1796875 C169.164062,58.6640649 168.982424,59.0742171 168.619141,59.4101562 C168.255858,59.7460954 167.824221,59.9140625 167.324219,59.9140625 Z M168.320312,68.5039062 C168.320312,68.949221 168.333984,69.6640576 168.361328,70.6484375 C168.388672,71.6328174 168.402344,72.347654 168.402344,72.7929688 C168.402344,73.246096 168.250002,73.6191392 167.945312,73.9121094 C167.640623,74.2050796 167.253909,74.3515625 166.785156,74.3515625 C166.316404,74.3515625 165.929689,74.2050796 165.625,73.9121094 C165.320311,73.6191392 165.167969,73.246096 165.167969,72.7929688 C165.167969,72.347654 165.154297,71.6328174 165.126953,70.6484375 C165.099609,69.6640576 165.085938,68.949221 165.085938,68.5039062 C165.085938,67.8085903 165.125,66.9375052 165.203125,65.890625 C165.28125,64.8437448 165.320312,63.9726597 165.320312,63.2773438 C165.320312,62.8242165 165.472655,62.4511733 165.777344,62.1582031 C166.082033,61.8652329 166.468748,61.71875 166.9375,61.71875 C167.406252,61.71875 167.792967,61.8652329 168.097656,62.1582031 C168.402345,62.4511733 168.554688,62.8242165 168.554688,63.2773438 C168.554688,63.9726597 168.515625,64.8437448 168.4375,65.890625 C168.359375,66.9375052 168.320312,67.8085903 168.320312,68.5039062 Z M177.285156,74.5390625 C175.417959,74.5390625 173.890631,74.0937545 172.703125,73.203125 C171.390618,72.2187451 170.734375,70.8320402 170.734375,69.0429688 C170.734375,67.0663964 171.253901,65.3945381 172.292969,64.0273438 C173.449225,62.5117112 175.007803,61.7539062 176.96875,61.7539062 C178.328132,61.7539062 179.457027,61.9726541 180.355469,62.4101562 C181.535162,62.9882841 182.125,63.8867127 182.125,65.1054688 C182.125,65.964848 181.644536,66.7265592 180.683594,67.390625 C180.246092,67.695314 179.367194,68.1406221 178.046875,68.7265625 L174.097656,70.4726562 C174.472658,70.8789083 174.925779,71.1835927 175.457031,71.3867188 C175.988284,71.5898448 176.597653,71.6914062 177.285156,71.6914062 C178.332036,71.6914062 179.218746,71.4765646 179.945312,71.046875 C180.593753,70.6640606 181.113279,70.4726562 181.503906,70.4726562 C182.31641,70.4726562 182.722656,70.8671836 182.722656,71.65625 C182.722656,72.5468795 182.070319,73.2734347 180.765625,73.8359375 C179.67187,74.3046898 178.511725,74.5390625 177.285156,74.5390625 Z M176.96875,64.5898438 C176.242184,64.5898438 175.621096,64.8320288 175.105469,65.3164062 C174.589841,65.8007837 174.175783,66.5273389 173.863281,67.4960938 C174.746098,67.1132793 175.624996,66.7343769 176.5,66.359375 C177.554693,65.8828101 178.394528,65.4414083 179.019531,65.0351562 C178.496091,64.7382798 177.812504,64.5898438 176.96875,64.5898438 Z M186.4375,70.5195312 C185.999998,70.5195312 185.638673,70.3828139 185.353516,70.109375 C185.068358,69.8359361 184.925781,69.4921896 184.925781,69.078125 C184.925781,68.773436 184.916016,68.3183624 184.896484,67.7128906 C184.876953,67.1074188 184.867188,66.6523453 184.867188,66.3476562 C184.867188,65.2695259 184.876953,63.6523545 184.896484,61.4960938 C184.916016,59.339833 184.925781,57.7226616 184.925781,56.6445312 C184.925781,56.2304667 185.070311,55.884767 185.359375,55.6074219 C185.648439,55.3300767 186.00781,55.1914062 186.4375,55.1914062 C186.86719,55.1914062 187.226561,55.3300767 187.515625,55.6074219 C187.804689,55.884767 187.949219,56.2304667 187.949219,56.6445312 L187.949219,69.078125 C187.949219,69.4921896 187.806642,69.8359361 187.521484,70.109375 C187.236327,70.3828139 186.875002,70.5195312 186.4375,70.5195312 Z M186.402344,74.7734375 C185.933591,74.7734375 185.496096,74.52344 185.089844,74.0234375 C184.722654,73.5624977 184.539062,73.1328145 184.539062,72.734375 C184.539062,72.328123 184.699217,71.9882826 185.019531,71.7148438 C185.339845,71.4414049 185.703123,71.3046875 186.109375,71.3046875 C186.578127,71.3046875 187.011717,71.554685 187.410156,72.0546875 C187.777346,72.5156273 187.960938,72.9414043 187.960938,73.3320312 C187.960938,73.7304707 187.802736,74.0703111 187.486328,74.3515625 C187.16992,74.6328139 186.808596,74.7734375 186.402344,74.7734375 Z');
    t.equal(
      JSON.stringify(ps4),
      '[{"x":134.183594,"y":63.6757812,"moveTo":true},{"curve":{"type":"cubic","x1":133.363277,"y1":66.7382966,"x2":132.539067,"y2":69.5195188},"x":131.710938,"y":72.0195312},{"curve":{"type":"cubic","x1":131.476561,"y1":72.7226598,"x2":131.093753,"y2":73.4453088},"x":130.5625,"y":74.1875},{"curve":{"type":"cubic","x1":130.187498,"y1":74.7031276,"x2":129.687503,"y2":74.9570313},"x":129.0625,"y":74.9492188},{"curve":{"type":"cubic","x1":128.07812,"y1":74.9335937,"x2":127.30469,"y2":73.9843844},"x":126.742188,"y":72.1015625},{"curve":{"type":"cubic","x1":126.531249,"y1":71.3828089,"x2":126.281251,"y2":70.0429786},"x":125.992188,"y":68.0820312},{"curve":{"type":"cubic","x1":125.828124,"y1":68.425783,"x2":125.726563,"y2":68.6562494},"x":125.6875,"y":68.7734375},{"curve":{"type":"cubic","x1":125.281248,"y1":69.7421923,"x2":124.687504,"y2":71.2460836},"x":123.90625,"y":73.2851562},{"curve":{"type":"cubic","x1":123.789062,"y1":73.6132829,"x2":123.613282,"y2":73.874999},"x":123.378906,"y":74.0703125},{"curve":{"type":"cubic","x1":123.05078,"y1":74.5937526,"x2":122.562503,"y2":74.8671874},"x":121.914062,"y":74.890625},{"curve":{"type":"cubic","x1":121.546873,"y1":74.9062501,"x2":121.160158,"y2":74.5781284},"x":120.753906,"y":73.90625},{"curve":{"type":"cubic","x1":120.324217,"y1":73.2265591,"x2":119.976564,"y2":72.3515679},"x":119.710938,"y":71.28125},{"curve":{"type":"cubic","x1":119.468749,"y1":70.3124952,"x2":119.093753,"y2":68.2031413},"x":118.585938,"y":64.953125},{"curve":{"type":"cubic","x1":118.476562,"y1":64.2499965,"x2":118.421875,"y2":63.6992207},"x":118.421875,"y":63.3007812},{"curve":{"type":"cubic","x1":118.421875,"y1":62.8710916,"x2":118.583983,"y2":62.5136733},"x":118.908203,"y":62.2285156},{"curve":{"type":"cubic","x1":119.232423,"y1":61.9433579,"x2":119.621091,"y2":61.8007812},"x":120.074219,"y":61.8007812},{"curve":{"type":"cubic","x1":120.917973,"y1":61.8007812,"x2":121.437499,"y2":62.2187458},"x":121.632812,"y":63.0546875},{"curve":{"type":"cubic","x1":121.734376,"y1":63.4921897,"x2":121.820312,"y2":64.0312468},"x":121.890625,"y":64.671875},{"curve":{"type":"cubic","x1":121.984375,"y1":65.5937546,"x2":122.042969,"y2":66.1367179},"x":122.066406,"y":66.3007812},{"curve":{"type":"cubic","x1":122.167969,"y1":66.9101593,"x2":122.324218,"y2":67.9062431},"x":122.535156,"y":69.2890625},{"curve":{"type":"cubic","x1":123.113284,"y1":67.7031171,"x2":123.77734,"y2":65.7304805},"x":124.527344,"y":63.3710938},{"curve":{"type":"cubic","x1":124.847658,"y1":62.3554637,"x2":125.449214,"y2":61.8476562},"x":126.332031,"y":61.8476562},{"curve":{"type":"cubic","x1":127.199223,"y1":61.8476562,"x2":127.76953,"y2":62.4140568},"x":128.042969,"y":63.546875},{"curve":{"type":"cubic","x1":128.238282,"y1":64.343754,"x2":128.445311,"y2":65.3788999},"x":128.664062,"y":66.6523438},{"curve":{"type":"cubic","x1":128.984377,"y1":68.5039155,"x2":129.179687,"y2":69.605467},"x":129.25,"y":69.9570312},{"curve":{"type":"cubic","x1":129.320313,"y1":69.7148425,"x2":129.933588,"y2":67.3398663},"x":131.089844,"y":62.8320312},{"curve":{"type":"cubic","x1":131.26172,"y1":62.1601529,"x2":131.749996,"y2":61.8242188},"x":132.554688,"y":61.8242188},{"curve":{"type":"cubic","x1":133.000002,"y1":61.8242188,"x2":133.392576,"y2":61.9687486},"x":133.732422,"y":62.2578125},{"curve":{"type":"cubic","x1":134.072267,"y1":62.5468764,"x2":134.242188,"y2":62.9062479},"x":134.242188,"y":63.3359375},{"curve":{"type":"cubic","x1":134.242188,"y1":63.4140629,"x2":134.222656,"y2":63.527343},"x":134.183594,"y":63.6757812,"closed":true},{"x":140.441406,"y":74.6914062,"moveTo":true},{"curve":{"type":"cubic","x1":138.996087,"y1":74.6914062,"x2":137.753911,"y2":74.1953175},"x":136.714844,"y":73.203125},{"curve":{"type":"cubic","x1":135.574213,"y1":72.1171821,"x2":134.976563,"y2":70.6679778},"x":134.921875,"y":68.8554688},{"curve":{"type":"cubic","x1":134.867187,"y1":67.1288976,"x2":135.339839,"y2":65.5898505},"x":136.339844,"y":64.2382812},{"curve":{"type":"cubic","x1":137.52735,"y1":62.6445233,"x2":139.179677,"y2":61.8476562},"x":141.296875,"y":61.8476562},{"curve":{"type":"cubic","x1":142.859383,"y1":61.8476562,"x2":144.101558,"y2":62.47265},"x":145.023438,"y":63.7226562},{"curve":{"type":"cubic","x1":145.851567,"y1":64.8476619,"x2":146.265625,"y2":66.2421792},"x":146.265625,"y":67.90625},{"curve":{"type":"cubic","x1":146.265625,"y1":69.7187591,"x2":145.781255,"y2":71.2656186},"x":144.8125,"y":72.546875},{"curve":{"type":"cubic","x1":143.726557,"y1":73.9765696,"x2":142.26954,"y2":74.6914062},"x":140.441406,"y":74.6914062,"closed":true},{"x":141.144531,"y":64.9414062,"moveTo":true},{"curve":{"type":"cubic","x1":140.183589,"y1":64.9335937,"x2":139.425784,"y2":65.3710893},"x":138.871094,"y":66.2539062},{"curve":{"type":"cubic","x1":138.402341,"y1":66.9960975,"x2":138.167969,"y2":67.8632763},"x":138.167969,"y":68.8554688},{"curve":{"type":"cubic","x1":138.167969,"y1":69.7929734,"x2":138.433591,"y2":70.5117163},"x":138.964844,"y":71.0117188},{"curve":{"type":"cubic","x1":139.386721,"y1":71.4101582,"x2":139.878903,"y2":71.609375},"x":140.441406,"y":71.609375},{"curve":{"type":"cubic","x1":141.121097,"y1":71.609375,"x2":141.710935,"y2":71.3789086},"x":142.210938,"y":70.9179688},{"curve":{"type":"cubic","x1":142.781253,"y1":70.3789036,"x2":143.085937,"y2":69.6484421},"x":143.125,"y":68.7265625},{"curve":{"type":"cubic","x1":143.226563,"y1":66.2109249,"x2":142.566413,"y2":64.9492188},"x":141.144531,"y":64.9414062,"closed":true},{"x":163.222656,"y":63.6757812,"moveTo":true},{"curve":{"type":"cubic","x1":162.40234,"y1":66.7382966,"x2":161.578129,"y2":69.5195188},"x":160.75,"y":72.0195312},{"curve":{"type":"cubic","x1":160.515624,"y1":72.7226598,"x2":160.132815,"y2":73.4453088},"x":159.601562,"y":74.1875},{"curve":{"type":"cubic","x1":159.226561,"y1":74.7031276,"x2":158.726566,"y2":74.9570313},"x":158.101562,"y":74.9492188},{"curve":{"type":"cubic","x1":157.117183,"y1":74.9335937,"x2":156.343753,"y2":73.9843844},"x":155.78125,"y":72.1015625},{"curve":{"type":"cubic","x1":155.570311,"y1":71.3828089,"x2":155.320314,"y2":70.0429786},"x":155.03125,"y":68.0820312},{"curve":{"type":"cubic","x1":154.867187,"y1":68.425783,"x2":154.765625,"y2":68.6562494},"x":154.726562,"y":68.7734375},{"curve":{"type":"cubic","x1":154.32031,"y1":69.7421923,"x2":153.726566,"y2":71.2460836},"x":152.945312,"y":73.2851562},{"curve":{"type":"cubic","x1":152.828124,"y1":73.6132829,"x2":152.652345,"y2":73.874999},"x":152.417969,"y":74.0703125},{"curve":{"type":"cubic","x1":152.089842,"y1":74.5937526,"x2":151.601566,"y2":74.8671874},"x":150.953125,"y":74.890625},{"curve":{"type":"cubic","x1":150.585936,"y1":74.9062501,"x2":150.199221,"y2":74.5781284},"x":149.792969,"y":73.90625},{"curve":{"type":"cubic","x1":149.363279,"y1":73.2265591,"x2":149.015626,"y2":72.3515679},"x":148.75,"y":71.28125},{"curve":{"type":"cubic","x1":148.507811,"y1":70.3124952,"x2":148.132815,"y2":68.2031413},"x":147.625,"y":64.953125},{"curve":{"type":"cubic","x1":147.515624,"y1":64.2499965,"x2":147.460938,"y2":63.6992207},"x":147.460938,"y":63.3007812},{"curve":{"type":"cubic","x1":147.460938,"y1":62.8710916,"x2":147.623045,"y2":62.5136733},"x":147.947266,"y":62.2285156},{"curve":{"type":"cubic","x1":148.271486,"y1":61.9433579,"x2":148.660154,"y2":61.8007812},"x":149.113281,"y":61.8007812},{"curve":{"type":"cubic","x1":149.957035,"y1":61.8007812,"x2":150.476562,"y2":62.2187458},"x":150.671875,"y":63.0546875},{"curve":{"type":"cubic","x1":150.773438,"y1":63.4921897,"x2":150.859375,"y2":64.0312468},"x":150.929688,"y":64.671875},{"curve":{"type":"cubic","x1":151.023438,"y1":65.5937546,"x2":151.082031,"y2":66.1367179},"x":151.105469,"y":66.3007812},{"curve":{"type":"cubic","x1":151.207032,"y1":66.9101593,"x2":151.36328,"y2":67.9062431},"x":151.574219,"y":69.2890625},{"curve":{"type":"cubic","x1":152.152347,"y1":67.7031171,"x2":152.816402,"y2":65.7304805},"x":153.566406,"y":63.3710938},{"curve":{"type":"cubic","x1":153.88672,"y1":62.3554637,"x2":154.488277,"y2":61.8476562},"x":155.371094,"y":61.8476562},{"curve":{"type":"cubic","x1":156.238286,"y1":61.8476562,"x2":156.808592,"y2":62.4140568},"x":157.082031,"y":63.546875},{"curve":{"type":"cubic","x1":157.277345,"y1":64.343754,"x2":157.484374,"y2":65.3788999},"x":157.703125,"y":66.6523438},{"curve":{"type":"cubic","x1":158.023439,"y1":68.5039155,"x2":158.21875,"y2":69.605467},"x":158.289062,"y":69.9570312},{"curve":{"type":"cubic","x1":158.359375,"y1":69.7148425,"x2":158.97265,"y2":67.3398663},"x":160.128906,"y":62.8320312},{"curve":{"type":"cubic","x1":160.300782,"y1":62.1601529,"x2":160.789058,"y2":61.8242188},"x":161.59375,"y":61.8242188},{"curve":{"type":"cubic","x1":162.039065,"y1":61.8242188,"x2":162.431639,"y2":61.9687486},"x":162.771484,"y":62.2578125},{"curve":{"type":"cubic","x1":163.11133,"y1":62.5468764,"x2":163.28125,"y2":62.9062479},"x":163.28125,"y":63.3359375},{"curve":{"type":"cubic","x1":163.28125,"y1":63.4140629,"x2":163.261719,"y2":63.527343},"x":163.222656,"y":63.6757812,"closed":true},{"x":167.324219,"y":59.9140625,"moveTo":true},{"curve":{"type":"cubic","x1":166.824216,"y1":59.9140625,"x2":166.390627,"y2":59.7460954},"x":166.023438,"y":59.4101562},{"curve":{"type":"cubic","x1":165.656248,"y1":59.0742171,"x2":165.472656,"y2":58.6640649},"x":165.472656,"y":58.1796875},{"curve":{"type":"cubic","x1":165.472656,"y1":57.6953101,"x2":165.656248,"y2":57.2851579},"x":166.023438,"y":56.9492188},{"curve":{"type":"cubic","x1":166.390627,"y1":56.6132796,"x2":166.824216,"y2":56.4453125},"x":167.324219,"y":56.4453125},{"curve":{"type":"cubic","x1":167.824221,"y1":56.4453125,"x2":168.255858,"y2":56.6132796},"x":168.619141,"y":56.9492188},{"curve":{"type":"cubic","x1":168.982424,"y1":57.2851579,"x2":169.164062,"y2":57.6953101},"x":169.164062,"y":58.1796875},{"curve":{"type":"cubic","x1":169.164062,"y1":58.6640649,"x2":168.982424,"y2":59.0742171},"x":168.619141,"y":59.4101562},{"curve":{"type":"cubic","x1":168.255858,"y1":59.7460954,"x2":167.824221,"y2":59.9140625},"x":167.324219,"y":59.9140625,"closed":true},{"x":168.320312,"y":68.5039062,"moveTo":true},{"curve":{"type":"cubic","x1":168.320312,"y1":68.949221,"x2":168.333984,"y2":69.6640576},"x":168.361328,"y":70.6484375},{"curve":{"type":"cubic","x1":168.388672,"y1":71.6328174,"x2":168.402344,"y2":72.347654},"x":168.402344,"y":72.7929688},{"curve":{"type":"cubic","x1":168.402344,"y1":73.246096,"x2":168.250002,"y2":73.6191392},"x":167.945312,"y":73.9121094},{"curve":{"type":"cubic","x1":167.640623,"y1":74.2050796,"x2":167.253909,"y2":74.3515625},"x":166.785156,"y":74.3515625},{"curve":{"type":"cubic","x1":166.316404,"y1":74.3515625,"x2":165.929689,"y2":74.2050796},"x":165.625,"y":73.9121094},{"curve":{"type":"cubic","x1":165.320311,"y1":73.6191392,"x2":165.167969,"y2":73.246096},"x":165.167969,"y":72.7929688},{"curve":{"type":"cubic","x1":165.167969,"y1":72.347654,"x2":165.154297,"y2":71.6328174},"x":165.126953,"y":70.6484375},{"curve":{"type":"cubic","x1":165.099609,"y1":69.6640576,"x2":165.085938,"y2":68.949221},"x":165.085938,"y":68.5039062},{"curve":{"type":"cubic","x1":165.085938,"y1":67.8085903,"x2":165.125,"y2":66.9375052},"x":165.203125,"y":65.890625},{"curve":{"type":"cubic","x1":165.28125,"y1":64.8437448,"x2":165.320312,"y2":63.9726597},"x":165.320312,"y":63.2773438},{"curve":{"type":"cubic","x1":165.320312,"y1":62.8242165,"x2":165.472655,"y2":62.4511733},"x":165.777344,"y":62.1582031},{"curve":{"type":"cubic","x1":166.082033,"y1":61.8652329,"x2":166.468748,"y2":61.71875},"x":166.9375,"y":61.71875},{"curve":{"type":"cubic","x1":167.406252,"y1":61.71875,"x2":167.792967,"y2":61.8652329},"x":168.097656,"y":62.1582031},{"curve":{"type":"cubic","x1":168.402345,"y1":62.4511733,"x2":168.554688,"y2":62.8242165},"x":168.554688,"y":63.2773438},{"curve":{"type":"cubic","x1":168.554688,"y1":63.9726597,"x2":168.515625,"y2":64.8437448},"x":168.4375,"y":65.890625},{"curve":{"type":"cubic","x1":168.359375,"y1":66.9375052,"x2":168.320312,"y2":67.8085903},"x":168.320312,"y":68.5039062,"closed":true},{"x":177.285156,"y":74.5390625,"moveTo":true},{"curve":{"type":"cubic","x1":175.417959,"y1":74.5390625,"x2":173.890631,"y2":74.0937545},"x":172.703125,"y":73.203125},{"curve":{"type":"cubic","x1":171.390618,"y1":72.2187451,"x2":170.734375,"y2":70.8320402},"x":170.734375,"y":69.0429688},{"curve":{"type":"cubic","x1":170.734375,"y1":67.0663964,"x2":171.253901,"y2":65.3945381},"x":172.292969,"y":64.0273438},{"curve":{"type":"cubic","x1":173.449225,"y1":62.5117112,"x2":175.007803,"y2":61.7539062},"x":176.96875,"y":61.7539062},{"curve":{"type":"cubic","x1":178.328132,"y1":61.7539062,"x2":179.457027,"y2":61.9726541},"x":180.355469,"y":62.4101562},{"curve":{"type":"cubic","x1":181.535162,"y1":62.9882841,"x2":182.125,"y2":63.8867127},"x":182.125,"y":65.1054688},{"curve":{"type":"cubic","x1":182.125,"y1":65.964848,"x2":181.644536,"y2":66.7265592},"x":180.683594,"y":67.390625},{"curve":{"type":"cubic","x1":180.246092,"y1":67.695314,"x2":179.367194,"y2":68.1406221},"x":178.046875,"y":68.7265625},{"x":174.097656,"y":70.4726562},{"curve":{"type":"cubic","x1":174.472658,"y1":70.8789083,"x2":174.925779,"y2":71.1835927},"x":175.457031,"y":71.3867188},{"curve":{"type":"cubic","x1":175.988284,"y1":71.5898448,"x2":176.597653,"y2":71.6914062},"x":177.285156,"y":71.6914062},{"curve":{"type":"cubic","x1":178.332036,"y1":71.6914062,"x2":179.218746,"y2":71.4765646},"x":179.945312,"y":71.046875},{"curve":{"type":"cubic","x1":180.593753,"y1":70.6640606,"x2":181.113279,"y2":70.4726562},"x":181.503906,"y":70.4726562},{"curve":{"type":"cubic","x1":182.31641,"y1":70.4726562,"x2":182.722656,"y2":70.8671836},"x":182.722656,"y":71.65625},{"curve":{"type":"cubic","x1":182.722656,"y1":72.5468795,"x2":182.070319,"y2":73.2734347},"x":180.765625,"y":73.8359375},{"curve":{"type":"cubic","x1":179.67187,"y1":74.3046898,"x2":178.511725,"y2":74.5390625},"x":177.285156,"y":74.5390625,"closed":true},{"x":176.96875,"y":64.5898438,"moveTo":true},{"curve":{"type":"cubic","x1":176.242184,"y1":64.5898438,"x2":175.621096,"y2":64.8320288},"x":175.105469,"y":65.3164062},{"curve":{"type":"cubic","x1":174.589841,"y1":65.8007837,"x2":174.175783,"y2":66.5273389},"x":173.863281,"y":67.4960938},{"curve":{"type":"cubic","x1":174.746098,"y1":67.1132793,"x2":175.624996,"y2":66.7343769},"x":176.5,"y":66.359375},{"curve":{"type":"cubic","x1":177.554693,"y1":65.8828101,"x2":178.394528,"y2":65.4414083},"x":179.019531,"y":65.0351562},{"curve":{"type":"cubic","x1":178.496091,"y1":64.7382798,"x2":177.812504,"y2":64.5898438},"x":176.96875,"y":64.5898438,"closed":true},{"x":186.4375,"y":70.5195312,"moveTo":true},{"curve":{"type":"cubic","x1":185.999998,"y1":70.5195312,"x2":185.638673,"y2":70.3828139},"x":185.353516,"y":70.109375},{"curve":{"type":"cubic","x1":185.068358,"y1":69.8359361,"x2":184.925781,"y2":69.4921896},"x":184.925781,"y":69.078125},{"curve":{"type":"cubic","x1":184.925781,"y1":68.773436,"x2":184.916016,"y2":68.3183624},"x":184.896484,"y":67.7128906},{"curve":{"type":"cubic","x1":184.876953,"y1":67.1074188,"x2":184.867188,"y2":66.6523453},"x":184.867188,"y":66.3476562},{"curve":{"type":"cubic","x1":184.867188,"y1":65.2695259,"x2":184.876953,"y2":63.6523545},"x":184.896484,"y":61.4960938},{"curve":{"type":"cubic","x1":184.916016,"y1":59.339833,"x2":184.925781,"y2":57.7226616},"x":184.925781,"y":56.6445312},{"curve":{"type":"cubic","x1":184.925781,"y1":56.2304667,"x2":185.070311,"y2":55.884767},"x":185.359375,"y":55.6074219},{"curve":{"type":"cubic","x1":185.648439,"y1":55.3300767,"x2":186.00781,"y2":55.1914062},"x":186.4375,"y":55.1914062},{"curve":{"type":"cubic","x1":186.86719,"y1":55.1914062,"x2":187.226561,"y2":55.3300767},"x":187.515625,"y":55.6074219},{"curve":{"type":"cubic","x1":187.804689,"y1":55.884767,"x2":187.949219,"y2":56.2304667},"x":187.949219,"y":56.6445312},{"x":187.949219,"y":69.078125},{"curve":{"type":"cubic","x1":187.949219,"y1":69.4921896,"x2":187.806642,"y2":69.8359361},"x":187.521484,"y":70.109375},{"curve":{"type":"cubic","x1":187.236327,"y1":70.3828139,"x2":186.875002,"y2":70.5195312},"x":186.4375,"y":70.5195312,"closed":true},{"x":186.402344,"y":74.7734375,"moveTo":true},{"curve":{"type":"cubic","x1":185.933591,"y1":74.7734375,"x2":185.496096,"y2":74.52344},"x":185.089844,"y":74.0234375},{"curve":{"type":"cubic","x1":184.722654,"y1":73.5624977,"x2":184.539062,"y2":73.1328145},"x":184.539062,"y":72.734375},{"curve":{"type":"cubic","x1":184.539062,"y1":72.328123,"x2":184.699217,"y2":71.9882826},"x":185.019531,"y":71.7148438},{"curve":{"type":"cubic","x1":185.339845,"y1":71.4414049,"x2":185.703123,"y2":71.3046875},"x":186.109375,"y":71.3046875},{"curve":{"type":"cubic","x1":186.578127,"y1":71.3046875,"x2":187.011717,"y2":71.554685},"x":187.410156,"y":72.0546875},{"curve":{"type":"cubic","x1":187.777346,"y1":72.5156273,"x2":187.960938,"y2":72.9414043},"x":187.960938,"y":73.3320312},{"curve":{"type":"cubic","x1":187.960938,"y1":73.7304707,"x2":187.802736,"y2":74.0703111},"x":187.486328,"y":74.3515625},{"curve":{"type":"cubic","x1":187.16992,"y1":74.6328139,"x2":186.808596,"y2":74.7734375},"x":186.402344,"y":74.7734375,"closed":true}]',
    );

    const ps5 = SVGPoints.pathToPoints('M296.3 73.5s101.05-40.5 133.37 15S513 201 457.48 222s-238.49 85.5-213 33 148.35-114 109.43-124.51-74.8-9-57.61-56.99z');
    t.equal(
      JSON.stringify(ps5),
      '[{"x":296.3,"y":73.5,"moveTo":true},{"curve":{"type":"cubic","x1":296.3,"y1":73.5,"x2":397.35,"y2":33},"x":429.67,"y":88.5},{"curve":{"type":"cubic","x1":461.99,"y1":144,"x2":513,"y2":201},"x":457.48,"y":222},{"curve":{"type":"cubic","x1":401.96000000000004,"y1":243,"x2":218.99,"y2":307.5},"x":244.48000000000002,"y":255},{"curve":{"type":"cubic","x1":269.97,"y1":202.5,"x2":392.83000000000004,"y2":141},"x":353.91,"y":130.49},{"curve":{"type":"cubic","x1":314.99,"y1":119.98000000000002,"x2":279.11,"y2":121.49000000000001},"x":296.3,"y":73.5,"closed":true}]',
    );

    const ps6 = SVGPoints.pathToPoints('M20,230 Q40,205 50,230 T90,230');
    t.deepEqual(
      ps6,
      [
        {x: 20, y: 230, moveTo: true},
        {
          curve: {type: 'cubic', x1: 33.33333333333333, y1: 213.33333333333334, x2: 43.333333333333336, y2: 213.33333333333334},
          x: 50,
          y: 230,
        },
        {
          curve: {type: 'cubic', x1: 50, y1: 230, x2: 63.333333333333336, y2: 230},
          x: 90,
          y: 230,
        },
      ],
    );

    t.end();
  },
);
